home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / dos / vprintf.c < prev    next >
C/C++ Source or Header  |  1996-09-13  |  2KB  |  80 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: vprintf.c,v 1.4 1996/09/13 17:50:09 digulla Exp $
  4.     $Log: vprintf.c,v $
  5.     Revision 1.4  1996/09/13 17:50:09  digulla
  6.     Use IPTR
  7.  
  8.     Revision 1.3  1996/08/13 13:52:53  digulla
  9.     Replaced <dos/dosextens.h> by "dos_intern.h" or added "dos_intern.h"
  10.     Replaced __AROS_LA by __AROS_LHA
  11.  
  12.     Revision 1.2  1996/08/01 17:40:59  digulla
  13.     Added standard header for all files
  14.  
  15.     Desc:
  16.     Lang: english
  17. */
  18. #include <clib/exec_protos.h>
  19. #include <dos/dos.h>
  20. #include "dos_intern.h"
  21.  
  22. void vfp_hook();
  23.  
  24. /*****************************************************************************
  25.  
  26.     NAME */
  27.     #include <clib/dos_protos.h>
  28.  
  29.     __AROS_LH2(LONG, VPrintf,
  30.  
  31. /*  SYNOPSIS */
  32.     __AROS_LHA(STRPTR, format,   D1),
  33.     __AROS_LHA(IPTR *, argarray, D2),
  34.  
  35. /*  LOCATION */
  36.     struct DosLibrary *, DOSBase, 159, Dos)
  37.  
  38. /*  FUNCTION
  39.  
  40.     INPUTS
  41.  
  42.     RESULT
  43.  
  44.     NOTES
  45.  
  46.     EXAMPLE
  47.  
  48.     BUGS
  49.  
  50.     SEE ALSO
  51.  
  52.     INTERNALS
  53.  
  54.     HISTORY
  55.     29-10-95    digulla automatically created from
  56.                 dos_lib.fd and clib/dos_protos.h
  57.  
  58. *****************************************************************************/
  59. {
  60.     __AROS_FUNC_INIT
  61.     __AROS_BASE_EXT_DECL(struct DosLibrary *,DOSBase)
  62.  
  63.     struct vfp vfp;
  64.     BPTR file=((struct Process *)FindTask(NULL))->pr_COS;
  65.  
  66.     vfp.file=file;
  67.     vfp.count=0;
  68.  
  69.     (void)RawDoFmt(format,argarray,vfp_hook,&vfp);
  70.  
  71.     /* Remove the last character (which is a NUL character) */
  72.     if(vfp.count>0)
  73.     {
  74.     vfp.count--;
  75.     ((struct FileHandle *)BADDR(file))->fh_Pos--;
  76.     }
  77.     return vfp.count;
  78.     __AROS_FUNC_EXIT
  79. } /* VPrintf */
  80.